<!DOCTYPE HTML>
<html>
<head>
<title>WinGetActiveStats | AutoHotkey</title>
<meta name="description" content="The WinGetActiveStats command combines the features of WinGetActiveTitle and WinGetPos into one command." />
<meta name="ahk:equiv-v2" content="commands/WinGetPos.htm" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script>
</head>
<body>

<h1>WinGetActiveStats</h1>

<p>组合了 <a href="WinGetActiveTitle.htm">WinGetActiveTitle</a> 和 <a href="WinGetPos.htm">WinGetPos</a> 两个命令的功能.</p>

<pre class="Syntax"><span class="func">WinGetActiveStats</span>, Title, Width, Height, X, Y</pre>
<h2 id="Parameters">参数</h2>
<dl>

  <dt>Title</dt>
  <dd><p>用来保存活动窗口标题的变量名.</p></dd>

  <dt>Width, Height</dt>
  <dd><p>用来保存活动窗口宽度和高度的变量名.</p></dd>

  <dt>X, Y</dt>
  <dd><p>用来保存活动窗口左上角的 X 和 Y 坐标的变量名.</p></dd>

</dl>

<h2 id="Remarks">备注</h2>
<p>如果没有找到匹配窗口, 则输出变量会被置空.</p>
<p>此命令相当于下面的语句序列:</p>
<pre><a href="WinGetTitle.htm">WinGetTitle</a>, Title, A
<a href="WinGetPos.htm">WinGetPos</a>, X, Y, Width, Height, A</pre>
<p>如果活动窗口为隐藏窗口且 <a href="DetectHiddenWindows.htm">DetectHiddenWindows</a> 处于关闭状态(默认状态), 除 <a href="WinShow.htm">WinShow</a> 外的所有命令都无法 "看见" 它. 由于此或其他任何原因而没有活动窗口, 那么此命令会设置所有的输出变量为空.</p>
<h2 id="Related">相关</h2>
<p><a href="WinGetPos.htm">WinGetPos</a>, <a href="WinGetActiveTitle.htm">WinGetActiveTitle</a>, <a href="WinGetTitle.htm">WinGetTitle</a>, <a href="WinGetClass.htm">WinGetClass</a>, <a href="WinGetText.htm">WinGetText</a>, <a href="ControlGetText.htm">ControlGetText</a></p>
<h2 id="Examples">示例</h2>
<div class="ex" id="ExBasic">
<p><a class="ex_number" href="#ExBasic"></a> 检索并报告活动窗口的标题, 大小和位置.</p>
<pre>WinGetActiveStats, Title, Width, Height, X, Y
MsgBox, The active window "%Title%" is %Width% wide`, %Height% tall`, and positioned at %X%`,%Y%.</pre>
</div>

</body>
</html>